//
//  CustomEmptyView.m
//  empty
//
//  Created by erongdu_cxk on 16/4/14.
//  Copyright © 2016年 erongdu. All rights reserved.
//

#import "CustomEmptyView.h"
@interface CustomEmptyView ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *centerY;

/**
 *  空态图
 */
@property (weak, nonatomic) IBOutlet UIImageView *emptyImage;
/**
 *  空态描述
 */
@property (weak, nonatomic) IBOutlet UILabel *emptyLabel;

@end

@implementation CustomEmptyView

- (instancetype)init
{
    if (self = [super init]) {
        UIView *temp = [[NSBundle mainBundle] loadNibNamed:@"CustomEmptyView" owner:self options:nil][0];
        temp.frame = [self bounds];
        
        [self addSubview:temp];

    }
    return self;
}
- (void)awakeFromNib
{
    [super awakeFromNib];
    self.backgroundColor = [UIColor clearColor];
    _emptyImage.image = [UIImage imageNamed:@"default"];
    self.centerY.constant = self.height * 4 / 15;
}

- (void)updateViewImage:(UIImage *)emptyImage description:(NSString *)text
{
    _emptyImage.image = emptyImage;
    _emptyLabel.text = text;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
